﻿/*
 * Created by SharpDevelop.
 * User: MyWife
 * Date: 4/16/2010
 * Time: 1:00 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using popLib;
using System.IO;

namespace AppStoreManager
{
	/// <summary>
	/// Description of IconForm.
	/// </summary>
	public partial class IconForm : Form
	{
		string _path = "";
		public IconForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
		}
		
		public void ViewForm(string path){
			if( path != _path ){
				string[] icons = FileLib.getFileList( path, "*.png", true, FileLib.SearchOption.FileOnly );
				listView1.Items.Clear();
				int index = 0;
				foreach( string icon in icons ){
					imageList1.Images.Add( Image.FromFile(icon) );
					ListViewItem item = listView1.Items.Add( Path.GetFileNameWithoutExtension( icon ), index );
					index++;
					if( index >= 30 ) break;
					item.BackColor = Color.Transparent;
					
				}
			}
			
			this.Show();
		}
	}
}
